<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf - 8">
        <meta name = "viewport" content="initial-scale= 1.0,maximum-scale=1.0,user-scalable=no">
        <title>

        </title>
        <script src="C:/Users/24098/Desktop/978-7-302-48199-7《HTML5 App应用开发教程》教辅/配套资源包/chapter06/scripts/jquery-3.1.1.min.js">
        </script>
    </head>
    <body>
        <input type="text" value="hello html5" id = "myinput" data-myattr = "huangbo"/>

        <script>
            $(function(){
                alert($("#myinput").data("myattr"));
                $("#myinput").data("mynewattr","Study HTML5");
                var x = $("#myinput").data("mynewattr");
                alert(x);
            });
        </script>

    </body>
</html>